package com.zzy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzy.domain.dto.ConsignorDto;
import com.zzy.domain.po.Consignor;
import com.zzy.domain.vo.PageResult;
import com.zzy.mapper.ConsignorMapper;
import com.zzy.service.ConsignorService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsignorServiceImpl extends ServiceImpl<ConsignorMapper, Consignor>implements ConsignorService {
    @Override
    public PageResult<Consignor> getpage(ConsignorDto dto) {
        PageHelper.startPage(dto.getPage(),dto.getPageSize());
        List<Consignor> list = baseMapper.getpage(dto);
        Page<Consignor>page= (Page<Consignor>) list;
        return new PageResult<>(page.getTotal(),page.getResult());
    }
}
